// gui/GuiSprite.h

#ifndef _GUI_GuiSprite_H_
#define _GUI_GuiSprite_H_

#ifndef _CORE_std_H_
#include <core/std.h>
#endif

#ifndef _GFX_Visual_H_
#include <gfx/Visual.h>
#endif

#ifndef _GUI_GuiComponent_H_
#include <gui/GuiComponent.h>
#endif

#ifndef _GFX_VisualSprite_H_
#include <gfx/VisualSprite.h>
#endif

namespace GUI
{

class GuiSprite : public GuiComponent
{
public:

	virtual TypeId		GetTypeId() const {
		return s_TypeId;
	}
	static TypeId		GetStaticTypeId() {
		return s_TypeId;
	}

	void				SetupGuiSprite( const Math::vec3 & vPos,
										GFX::Texture * pTexture,
										CORE::Colour & colSprite,
										float32_t fWidth = 0.0f,
										float32_t fHeight = 0.0f);

	void				SetupAtlasGuiSprite( const Math::vec3 & vPos,
										GFX::Texture * pTexture,
										CORE::Colour & colSprite,
										float32_t fWidth,
										float32_t fHeight,
										const GFX::Visual::AtlasInfo &atlasInfo);

	// Accessors
	void				SetScale( float32_t fScaleX, float32_t fScaleY );

	// APIs
	virtual void		Update( CORE::Time & TimeDelta ) {;};
	virtual void		Render( IRenderingEngine * pRenderer );

private:

	static TypeId			s_TypeId;
	GFX::VisualSprite		m_Sprite;
};

// inline functions
inline void GuiSprite::SetScale( float32_t fScaleX, float32_t fScaleY )
{
	// fScaleX > 0.0f && fScaleY > 0.0f
	m_Sprite.SetScale( fScaleX, fScaleY );
}

}; // namespace GUI


#endif // _GUI_GuiSprite_H_